#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
@Time        : 2021/11/25 15:55
@Author      : Albert Darren
@Contact     : 2563491540@qq.com
@File        : dog.py
@Version     : Version 1.0.0
@Description : TODO
@Created By  : PyCharm
"""
from skimage.feature import blob_dog
from skimage.io import imread
import matplotlib.pyplot as plt

IM_PATH = "../experiment_fig/fish.jpg"
im = imread(IM_PATH)
gray_im = im[:, :, 0]
dog_blobs = blob_dog(gray_im)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.imshow(gray_im, cmap="gray")
for blob in dog_blobs:
    y, x, row = blob
    circle = plt.Circle((x, y), row, color='red', linewidth=2, fill=False)
    ax.add_artist(circle)
plt.show()
